package com.cc;

import com.cc.dao.CarDao;
import com.cc.service.CarService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );

        //创建IOC容器
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

//        CarDao carDao = ctx.getBean(CarDao.class);
//
//        carDao.getCar();

        CarService carService = ctx.getBean(CarService.class);

        carService.getCar();
    }
}
